package zelix.utils.hooks.visual;

import zelix.utils.system.EnumChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;

public class ChatUtils{	// TODO Rewrite to LogManager 
	public static void component(ITextComponent component)
	{

			Minecraft.getMinecraft().ingameGUI.getChatGUI()
					.printChatMessage(new TextComponentString(EnumChatFormatting.RED+"["+EnumChatFormatting.GOLD+"Zelix"+EnumChatFormatting.RED+"]"+EnumChatFormatting.WHITE+" ")
							.appendSibling(component));
	}

	public static void componentIRC(ITextComponent component)
	{

		Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(new TextComponentString("").appendSibling(component));
	}
	public static void messageIRC(String message)
	{
		componentIRC(new TextComponentString(message));
	}
	public static void IRC(String message)
	{
		messageIRC(EnumChatFormatting.RED+"["+EnumChatFormatting.GOLD+"IRC"+EnumChatFormatting.RED+"]"+EnumChatFormatting.WHITE+" " + message);
	}

	public static void message(String message)
	{
		component(new TextComponentString(message));
	}
	public static void warning(String message)
	{
		message(EnumChatFormatting.RED+"["+EnumChatFormatting.GOLD+EnumChatFormatting.BOLD+"WARNING"+EnumChatFormatting.RED+"]"+EnumChatFormatting.WHITE+" " + message);
	}
	public static void error(String message)
	{
		message(EnumChatFormatting.RED+"["+EnumChatFormatting.DARK_RED+""+EnumChatFormatting.BOLD+"ERROR"+EnumChatFormatting.RED+"]"+EnumChatFormatting.WHITE+" " + message);
	}

	public static void success(String message)
	{
		message(EnumChatFormatting.GREEN+"["+EnumChatFormatting.DARK_GREEN+EnumChatFormatting.BOLD+"SUCCESS"+EnumChatFormatting.GREEN+"]"+EnumChatFormatting.WHITE+" " + message);
	}

	public static void failure(String message)
	{
		message(""+EnumChatFormatting.RED+"["+EnumChatFormatting.DARK_RED+""+EnumChatFormatting.BOLD+"FAILURE"+EnumChatFormatting.RED+"]"+EnumChatFormatting.WHITE+" " + message);
	}
}
